$(document).ready(function(){
    $.ajax({
        type:"GET",
        url:"/TestHome/Index/getUserInfo",
        dataType:"json",
        success:function(data){

            $("#username-top").html(data.username);
            $("#time-top").html(data.time);

            if (data.is_org == 1){
                $(".org-li").show();
            }

        },error: function (jqXHR) {
            alert("获取用户基本信息failed"+jqXHR.status);
        }
    });

    $.ajax({
        type:"GET",
        url:"/TestHome/Index/getQuizList",
        dataType:"json",
        async : false,
        success:function(data){


            if(data.orgnizer == 1){

                $("#top-badge").html('<div class="badge badge-top bg-danger animated flash">'+Object.keys(data.detail).length+'</div>');

            }

        },error: function (jqXHR) {
            alert("顶部通知失败failed"+jqXHR.status);
        }
    });

});